<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
    <link rel="stylesheet" type="text/css" th:href="@{{path}/common/webuploader/webuploader.css?v={v}(v=${v},path=${staticPath})}"/>
    <link rel="stylesheet" type="text/css" th:href="@{{path}/common/v3/summernote/summernote-bs3.css?v={v}(path=${staticPath},v=${v})}"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInLeft">
    <div data-th-replace="common/functionDepict"></div>
    <div>
        <div class="row">
            <div class="pt10">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5 id="course-animate">填写基本信息</h5>
                        </div>
                        <div class="ibox-content clearfix pt10">
                            <form id="save-form">
                                <input type="hidden" name="id" th:value="${entity['id']}">
                                <input type="hidden" name="imageJson" th:value="${entity['imageJson']}">
                                <input type="hidden" name="shopType" th:value="${entity['shopType']}==null?'ENTITY':${entity['shopType']}" >
                                <div class="form-horizontal">
                                    <div class="form-group">
                                        <label  class="col-sm-2 control-label text-right">
                                            <i class="c-red">*</i>
                                            商品名称
                                        </label>
                                        <div class="col-sm-8">
                                            <input class="form-control" th:readonly="${entity['name']}!=null and ${entity['name']}!='' " th:value="${entity['name']}" name="name"           >
                                            <span  class="help-block m-b-none c-999">
                                                商品名称 限60个字符以内
                                            </span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div  class="form-group real-price">
                                        <label class="col-sm-2 control-label text-right">  <i class="c-red">*</i> 兑换消耗积分</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b">
                                                <input class="form-control course-price-in" th:value="${entity['integral']}" maxlength="9" name="integral"/>
                                            </div>
                                            <span class="help-block m-b-none c-999">  兑换消耗积分，单位为个，不可为小数</span>
                                        </div>
                                    </div>

                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                    <label class="col-sm-2 control-label"><i class="c-red">*</i> 商品形态</label>
                                    <div class="col-sm-8">
                                        <div class="radio i-checks">
                                            <label>
                                                <input  name="type" class="course-type-key" th:disabled="${entity['type']}!=null" th:checked="(${entity['type']}==1 or ${entity['type']}==0 or   ${entity['type']}==null)" type="radio"  value="1"/>
                                                <span class="fs14">实体商品</span>
                                            </label>
                                            <label>
                                                <input  name="type" class="course-type-key" th:disabled="${entity['type']}!=null" th:checked="${entity['type']}==2" type="radio"  value ="2"/>
                                                <span class="fs14">虚拟商品</span>
                                            </label>
                                        </div>
                                        <span class="help-block m-b-none c-999">商品创建后不可修改商品形态品</span>
                                    </div>
                                   </div>
                                    <div class="hr-line-dashed shopData" th:classappend="${entity['type']}!=2?'hide':''"></div>
                                    <div  class="form-group real-price shopData" th:classappend="${entity['type']}!=2?'hide':''" >
                                        <label class="col-sm-2 control-label text-right">选择平台商品</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b">
                                                <button class="btn btn-primary " th:disabled="!(${entity['shopData']}==null)" type="button" id="openCoupons">设置平台商品</button>
                                            </div>
                                            <div id="user-div" class="well m-t mt10 no-padding">
                                                <ul class="list-group">
                                                    <li class="list-group-item">
                                                        <input id="couponId" type="hidden"  name="shopId" th:value="${entity['shopId']}" />
                                                        <span class="pull-right">
                                                                <a  href="javascript:void(0);" id="reomve-coupon" title="移除" class="c-999 fs14 hide"><i class="fa fa-remove" ></i></a>
                                                            </span>
                                                            <span class="fs14" id="couponIdName">
                                                                <span  th:text="${entity['shopData']}!=null ?${entity['shopData']['name']}:'选择后库存由商品的数量决定，课程除外'">选择后库存由商品的数量决定(课程除外)</span>
                                                            </span>
                                                    </li>
                                                </ul>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div  class="form-group real-price">
                                        <label class="col-sm-2 control-label text-right">  <i class="c-red">*</i> 库存</label>
                                        <div class="col-sm-10">
                                            <div class="input-group m-b">
                                                <input class="form-control course-price-in" th:readonly="${entity['inventory']}!=null? (${entity['status']} == 3 ?true: !(${entity['shopType']} eq 'COURSE' or  ${entity['shopType']} eq 'ENTITY'))  :false " th:value="${entity['inventory']}" maxlength="9" name="inventory"/>
                                            </div>
                                            <span class="help-block m-b-none c-999">不可为小数</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i>  商品封面</label>
                                        <div class="col-sm-10">
                                            <p>
                                                <button class="btn btn-primary " type="button" id="courseImage"><i class="fa fa-image"></i>&nbsp;上传封面</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;建议尺寸为：750*450或者16:9比例，大小不超过2M的jpg、jpeg、png等
                                            </p>
                                            <div class="clearfix" id="coverImage">
                                                <div class="file-box">
                                                    <div class="file">
                                                        <span class="corner" title="删除" id="remove-image"><i class="fa fa-remove"></i></span>
                                                        <div class="image">
                                                            <img alt="课程封面" id="material-image" class="img-responsive" th:src="!${#maps.isEmpty(entity['imageMap'])} ? ${entity['imageMap']['pcUrlMap']['large']} : @{{path}/admin/v3/img/default/default-pic.jpg?v={v}(path=${staticPath},v=${v})}"/>
                                                        </div>
                                                        <div class="file-name">
                                                            <p id="file-names" th:text="!${#maps.isEmpty(entity['imageMap'])} and ${entity['imageMap']['fileName']}!=null ? ${entity['imageMap']['fileName']}:'文件名'"></p>
                                                            <small id="create-time" th:text="!${#maps.isEmpty(entity['imageMap'])} and ${entity['imageMap']['createTime']}!=null ? ${entity['imageMap']['createTime']}:'上传时间'"></small>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label  class="col-sm-2 control-label text-right"> <i class="c-red">*</i>  商品介绍</label>
                                        <div class="col-sm-9">
                                            <textarea  th:text="${entity['details']}" id="context" name="details"></textarea>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <div class="col-sm-10 col-sm-offset-2">
                                            <button class="btn btn-primary" type="button" id="save">保存</button>
                                            <button class="btn btn-white ml10 saveCancel" type="button">取消</button>
                                        </div>
                                    </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div data-th-replace="layout/head-footer"></div>
<script th:src="@{{path}/common/webuploader/webuploader.js?v={v}(v=${v},path=${staticPath})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/upload/common-webuploader.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/common/summernote/summernote.min.js?v={v}(path=${staticPath},v=${v})}"></script>
<script type="text/javascript" th:src="@{{path}/admin/business/integragood/initgood.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
